using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace TimeLogger
{
    public partial class OptionsForm : Form
    {
        public OptionsForm()
        {
            InitializeComponent();
        }

        private void OptionsForm_Load(object sender, EventArgs e)
        {
            txtUrl.Text = Properties.Settings.Default.BasecampHost;
            txtUsername.Text = Properties.Settings.Default.BasecampUsername;
            txtPassword.Text = Properties.Settings.Default.BasecampPassword;
            txtPersonID.Text = Properties.Settings.Default.BasecampPersonId.ToString();
        }

        private void btnOk_Click(object sender, EventArgs e)
        {
            Properties.Settings.Default.BasecampHost = txtUrl.Text;
            Properties.Settings.Default.BasecampUsername = txtUsername.Text;
            Properties.Settings.Default.BasecampPassword = txtPassword.Text;
            Properties.Settings.Default.BasecampPersonId = Convert.ToInt32(txtPersonID.Text);
            Properties.Settings.Default.Save();
            this.Close();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}